﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace Security.Connect
{
    [Export(typeof(IConnectionContainer))]
    internal class ConnectionContainer : IConnectionContainer
    {
        private SqlConnection connection;

        [Export]
        public SqlConnection Connection
        {
            get
            {
                if (connection == null)
                    connection = new SqlConnection();

                return connection;
            }
        }
    }

    public interface IConnectionContainer
    {
        SqlConnection Connection { get; }
    }
}
